#include "func_handler.h"
#include "start_win.h"
bit is_btn_scan=0;

void btn_click_tick()
{
	#define BTN_SCAN_PERIOD		30
	static idata u8 tick = 0;
	tick++;
	if(tick==BTN_SCAN_PERIOD)
	{
		tick = 0;
		is_btn_scan = 1;
	}
}
void btn_click_handler()
{
	#define  BTN_VAL_ADDR 0x1000
	u16 btn_val;
	if(is_btn_scan==0)
		return;
	is_btn_scan = 0;
	sys_read_vp(BTN_VAL_ADDR,(u8*)&btn_val,1);
	if(btn_val<=0x10)
			start_win_btn_click_handler(btn_val);
	btn_val = 0;
	sys_write_vp(BTN_VAL_ADDR,(u8*)&btn_val,1);
		
}





